<!-- 项目明细CSS -->
<div th:fragment="project-css">
    <style>
        .info-header{
            font-size: 20px;
            font-family: PingFangSC-Semibold, PingFang SC;
            font-weight: 600;
            color: #1A1A1A;
            line-height: 28px;
            padding-bottom: 12px;
        }
        .info-label,.info-value{
            font-family: PingFangSC-Regular, PingFang SC;
            font-weight: 400;
            line-height: 22px;
            font-size: 0;
            display: inline-block;
            vertical-align: middle;
        }
        .info-label{
            width: 130px;
            color: #666666;
            font-size: 14px;
            padding-bottom: 12px;
            padding-top: 12px;
        }
        .info-value{
            width: calc(100% - 143px);
            color: #1A1A1A;
            font-size: 14px;
        }
    </style>
</div>
<!-- 项目基本信息 -->
<div th:fragment="projectInfo">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5 style="font: bold">项目基本信息</h5>
            <div class="ibox-tools">
                <a class="collapse-link" id="_projectInfo_link">
                    <i class="fa fa-chevron-up"></i>
                </a>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="col-md-6">
                        <div class="info-label">项目名称</div>
                        <div class="info-value" th:text="${project.projectName}"></div>
                        <input type="hidden" id="projectId" th:value="${project.projectId}">
                    </div>
                    <div class="col-md-6">
                        <div class="info-label">项目类型</div>
                        <input type="hidden" id="projectTypeInput" th:value="${project.projectType}">
                        <div class="info-value" th:text="${@dict.getLabel('eb_project_type',project.projectType)}"></div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="col-md-6">
                        <div class="info-label">建设性质</div>
                        <div class="info-value" th:text="${@dict.getLabel('eb_construction_type',project.constructionType)}"></div>
                    </div>
                    <div class="col-md-6">
                        <div class="info-label">项目标签</div>
                        <input type="hidden" id="projectLabelInput" th:value="${project.projectLabel}">
                        <div class="info-value" id="projectLabelDiv"></div>
                    </div>
                </div>
            </div>
        </div>
        <div class="ibox-content">
            <div class="row">
                <div class="col-sm-12">
                    <div class="col-md-6">
                        <div class="info-label">项目所属产业</div>
                        <div class="info-value" th:text="${@dict.getLabel('eb_project_industry',project.projectIndustry)}"></div>
                    </div>
                    <div class="col-md-6">
                        <div class="info-label">审批类型</div>
                        <div class="info-value" th:text="${@dict.getLabel('eb_approve_type',project.approveType)}"></div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="col-md-6">
                        <div class="info-label" th:if="${project.constructionType == 1}">是否开工</div>
                        <div class="info-label" th:if="${project.constructionType == 2}">是否复工</div>
                        <div class="info-value" th:text="${@dict.getLabel('eb_yes_no',project.isBegin)}"></div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="col-md-6">
                        <div class="info-label">立项代码</div>
                        <div class="info-value" th:text="${project.projectCode}"></div>
                    </div>
                    <div class="col-md-6" id="fundDemandDiv" style="display: none">
                        <div class="info-label">资金需求</div>
                        <div class="info-value" th:text="${project.fundDemand != null?#numbers.formatDecimal(project.fundDemand,1,2):'-'} + ' 亿元'"></div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="col-md-6" id="projectBatchDiv" style="display: none">
                        <div class="info-label">"三个一批"批次</div>
                        <div class="info-value" th:text="${@dict.getLabel('eb_project_batch',project.projectBatch)}"></div>
                    </div>
                    <div class="col-md-6" id="projectWorthExpectDiv" style="display: none">
                        <div class="info-label">项目建成预计年产值</div>
                        <div class="info-value" th:text="${project.projectWorthExpect != null?#numbers.formatDecimal(project.projectWorthExpect,1,2):'-'} + '亿元'"></div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="col-md-6">
                        <div class="info-label">建设地点</div>
                        <div class="info-value" th:text="${@dict.getLabel('eb_project_area',project.projectArea)}"></div>
                    </div>
                    <div class="col-md-6">
                        <div class="info-label">项目详细建设地点</div>
                        <div class="info-value" th:text="${project.projectAddress}"></div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="col-md-6">
                        <div class="info-label">地理坐标</div>
                        <div class="info-value" th:text="'经度' + ${project.longitude} + ' 纬度' + ${project.latitude}"></div>
                    </div>
                    <div class="col-md-6">
                        <div class="info-label">计划开工时间</div>
                        <div class="info-value" th:text="${#dates.format(project.beginDatePlan, 'yyyy-MM-dd')}"></div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="col-md-6">
                        <div class="info-label">计划竣工时间</div>
                        <div class="info-value" th:text="${#dates.format(project.endDatePlan, 'yyyy-MM-dd')}"></div>
                    </div>
                    <div class="col-md-6">
                        <div class="info-label">建设周期（月）</div>
                        <div class="info-value" th:text="${project.constructionCycle}"></div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="col-md-6">
                        <div class="info-label">建设内容及规模</div>
                        <div class="info-value" th:text="${project.projectIntroduct}"></div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="col-md-6">
                        <div class="info-label">存在问题</div>
                        <div class="info-value" th:text="${project.projectProblem}"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 项目建设单位信息 -->
<div th:fragment="projectConstructorInfo">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5 style="font: bold">项目建设单位信息</h5>
            <div class="ibox-tools">
                <a class="collapse-link">
                    <i class="fa fa-chevron-up"></i>
                </a>
            </div>
        </div>
        <div class="ibox-content">
            <div class="row">
                <div class="col-sm-12">
                    <div class="col-md-6">
                        <div class="info-label">单位名称</div>
                        <div class="info-value" th:text="${project.constructorName}"></div>
                    </div>
                    <div class="col-md-6">
                        <div class="info-label">统一社会信用代码</div>
                        <div class="info-value" th:text="${project.constructorCode}"></div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="col-md-6">
                        <div class="info-label">法人代表名称</div>
                        <div class="info-value" th:text="${project.constructorCorp}"></div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="col-md-6">
                        <div class="info-label">联系人</div>
                        <div class="info-value" th:text="${project.contactPerson}"></div>
                    </div>
                    <div class="col-md-6">
                        <div class="info-label">手机号码</div>
                        <div class="info-value" th:text="${project.contactPhone}"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 项目资金落实信息 -->
<div th:fragment="projectInvestInfo(title)">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5 style="font: bold" th:text="${title}"></h5>
            <div class="ibox-tools">
                <a class="collapse-link">
                    <i class="fa fa-chevron-up"></i>
                </a>
            </div>
        </div>
        <div class="ibox-content">
            <div class="row">
                <div class="col-sm-12">
                    <div class="col-md-4">
                        <div class="info-label">总投资</div>
                        <div class="info-value" th:text="${project.totalInvest != null?#numbers.formatDecimal(project.totalInvest,1,2):'-'} + ' 亿元'"></div>
                    </div>
                    <div class="col-md-4">
                        <div class="info-label">资金需求</div>
                        <div class="info-value" th:text="${project.fundDemand != null?#numbers.formatDecimal(project.fundDemand,1,2):'-'} + ' 亿元'"></div>
                    </div>
                    <div class="col-md-4">
                        <div class="info-label" th:text="${currentYear} + '年计划投资：'"></div>
                        <div class="info-value" th:text="${project.planInvest != null?#numbers.formatDecimal(project.planInvest,1,2):'-'} + ' 亿元'"></div>
                    </div>
                </div>
            </div>
            <div class="col-md-12">
                <div class="hr-line-dashed"></div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="col-md-4">
                        <div class="info-label">已累计完成投资</div>
                        <div class="info-value" th:text="${project.doneInvest != null?#numbers.formatDecimal(project.doneInvest,1,2):'-'} + ' 亿元'"></div>
                    </div>
                    <!--<div class="col-md-6">
                        <div class="info-label">实际到位资金</div>
                        <div class="info-value" th:text="${project.actualInvest != null?#numbers.formatDecimal(project.actualInvest,1,2):'-'} + ' 亿元'"></div>
                    </div>-->
                    <div class="col-md-4"  th:each="investStat : ${investStat}">
                        <div class="info-label control-label" th:text="${investStat.year} + '累计完成投资'"></div>
                        <div class="info-value" th:text="${investStat.doneInvest != null?#numbers.formatDecimal(investStat.doneInvest,1,2):'-'} + ' 亿元'"></div>
                    </div>
                </div>
            </div>
            <div class="col-md-12">
                <div class="hr-line-dashed"></div>
            </div>
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5 style="font: bold" th:text="${currentYear} + '年投资情况'"></h5>
                    <div class="ibox-tools">
                        <a class="collapse-link" id="_projectInfo_link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="col-md-6">
                                <div class="col-md-12" th:each="detail : ${projectInvestDetails}">
                                    <div class="info-label" th:text="${detail.month} + '月：'"></div>
                                    <div class="info-value" th:text="${detail.doneInvest != null?#numbers.formatDecimal(detail.doneInvest,1,2):'-'} + ' 亿元'"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 流转过程 -->
<div th:fragment="approveLogs">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5 style="font: bold">流转过程</h5>
            <div class="ibox-tools">
                <a class="collapse-link">
                    <i class="fa fa-chevron-up"></i>
                </a>
            </div>
        </div>
        <div class="ibox-content">
            <div id="vertical-timeline" class="vertical-container light-timeline">
                <div class="vertical-timeline-block" th:each="log : ${approveLogs}">
                    <div th:class="${(log.approveResult == 30 || log.approveResult == 10) ? 'vertical-timeline-icon red-bg' : 'vertical-timeline-icon navy-bg'}">
                        <i class="fa fa-briefcase"></i>
                    </div>
                    <div class="vertical-timeline-content">
                        <h2 th:text="${log.remark}"></h2>
                        <p th:text="${log.createBy} + ' ' + ${#dates.format(log.createTime, 'yyyy-MM-dd HH:mm:ss')}"></p>
                        <span th:text="${log.approveComment}"></span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 项目明细展示JS -->
<div th:fragment="project-js">
    <script th:inline="javascript">
        $(document).ready(function(e) {
            // 获取字典数据
            var projectLabelDatas = [[${@dict.getType('eb_project_label')}]];
            var projectLabel = $('#projectLabelInput').val();
            if (projectLabel) {
                var labelStr = "";
                var projectLabelList = projectLabel.split(",");
                for (var i=0; i<projectLabelList.length; i++) {
                    if (projectLabelList[i] == 20) {
                        $("#projectBatchDiv").show();
                    }
                    if (projectLabelList[i] == 40) {
                        $("#fundDemandDiv").show();
                    }
                    labelStr = labelStr + " " + $.table.selectDictLabel(projectLabelDatas, projectLabelList[i]);
                }
                $('#projectLabelDiv').html(labelStr);
            }
            var projectType = $('#projectTypeInput').val();
            if (projectType == 20) {
                $("#projectWorthExpectDiv").show();
            }
        });

        $(".modal").appendTo("body"), $("[data-toggle=popover]").popover(), $(".collapse-link").click(function() {
            var div_ibox = $(this).closest("div.ibox"),
                e = $(this).find("i"),
                i = div_ibox.find("div.ibox-content");
            i.slideToggle(200),
                e.toggleClass("fa-chevron-up").toggleClass("fa-chevron-down"),
                div_ibox.toggleClass("").toggleClass("border-bottom"),
                setTimeout(function() {
                    div_ibox.resize();
                }, 50);
        }), $(".close-link").click(function () {
            var div_ibox = $(this).closest("div.ibox");
            div_ibox.remove()
        });
    </script>
</div>
<!-- 资金增调历史 -->
<div th:fragment="investHistory">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5 style="font: bold">历史调增</h5>
            <div class="ibox-tools">
                <a class="collapse-link">
                    <i class="fa fa-chevron-up"></i>
                </a>
            </div>
        </div>
        <div class="ibox-content">
            <div class="row">
                <div class="col-sm-12">
                    <table class="table table-hover margin bottom">
                        <thead>
                        <tr>
                            <th>总投资</th>
                            <th>已累计完成投资</th>
                            <th>实际到位资金</th>
                            <th>2022年计划投资</th>
                            <th>资金需求</th>
                            <th>更新日期</th>
                            <th>经办人</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="projectInvest : ${projectInvests}">
                            <td th:text="${projectInvest.totalInvest!=null?#numbers.formatDecimal(projectInvest.totalInvest,1,2):'-'}">0</td>
                            <td th:text="${projectInvest.doneInvest!=null?#numbers.formatDecimal(projectInvest.doneInvest,1,2):'-'}">0</td>
                            <td th:text="${projectInvest.actualInvest!=null?#numbers.formatDecimal(projectInvest.actualInvest,1,2):'-'}">0</td>
                            <td th:text="${projectInvest.planInvest!=null?#numbers.formatDecimal(projectInvest.planInvest,1,2):'-'}">0</td>
                            <td th:text="${projectInvest.fundDemand!=null?#numbers.formatDecimal(projectInvest.fundDemand,1,2):'-'}">0</td>
                            <td th:text="${#dates.format(projectInvest.updateTime, 'yyyy-MM-dd HH:mm:ss')}"></td>
                            <td th:text="${projectInvest.updateBy}"></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 项目六定 -->
<div th:fragment="projectSixDone">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5 style="font: bold">六定信息</h5>
            <div class="ibox-tools">
                <a class="collapse-link">
                    <i class="fa fa-chevron-up"></i>
                </a>
            </div>
        </div>
        <div class="ibox-content">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5 style="font: bold">定网络</h5>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="col-md-6">
                                <div class="info-label">建设内容及规模</div>
                                <div class="info-value" th:text="${project.projectIntroduct}"></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5 style="font: bold" th:text="定资金"></h5>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="col-md-6">
                                <div class="info-label">总投资</div>
                                <div class="info-value" th:text="${project.totalInvest != null?#numbers.formatDecimal(project.totalInvest,1,2):'-'} + ' 亿元'"></div>
                            </div>
                            <div class="col-md-6">
                                <div class="info-label">已累计完成投资</div>
                                <div class="info-value" th:text="${project.doneInvest != null?#numbers.formatDecimal(project.doneInvest,1,2):'-'} + ' 亿元'"></div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="col-md-6">
                                <div class="info-label">实际到位资金</div>
                                <div class="info-value" th:text="${project.actualInvest != null?#numbers.formatDecimal(project.actualInvest,1,2):'-'} + ' 亿元'"></div>
                            </div>
                            <div class="col-md-6">
                                <div class="info-label">2022年计划投资</div>
                                <div class="info-value" th:text="${project.planInvest != null?#numbers.formatDecimal(project.planInvest,1,2):'-'} + ' 亿元'"></div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="col-md-6">
                                <div class="info-label">资金需求</div>
                                <div class="info-value" th:text="${project.fundDemand != null?#numbers.formatDecimal(project.fundDemand,1,2):'-'} + ' 亿元'"></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5 style="font: bold">定措施</h5>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="col-md-6">
                                <div class="info-label">推进措施</div>
                                <div class="info-value" th:text="${project.projectMeasure}"></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5 style="font: bold">定专班</h5>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="col-md-6">
                                <div class="info-label">项目推进专班</div>
                                <div class="info-value" th:text="${project.projectDirector}"></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5 style="font: bold">定责任</h5>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="col-md-6">
                                <div class="info-label">项目责任人</div>
                                <div class="info-value" th:text="${project.responseName}"></div>
                            </div>
                            <div class="col-md-6">
                                <div class="info-label">手机号码</div>
                                <div class="info-value" th:text="${project.responsePhone}"></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5 style="font: bold">定考核</h5>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="col-sm-3">
                                <div class="info-label">2022年第一季度拟完成投资</div>
                                <div class="info-value" th:text="${project.planInvestQuarter1 != null?#numbers.formatDecimal(project.planInvestQuarter1,1,2):'-'} + ' 亿元'"></div>
                            </div>
                            <div class="col-sm-3">
                                <div class="info-label">2022年第二季度拟完成投资</div>
                                <div class="info-value" th:text="${project.planInvestQuarter2 != null?#numbers.formatDecimal(project.planInvestQuarter2,1,2):'-'} + ' 亿元'"></div>
                            </div>
                            <div class="col-sm-3">
                                <div class="info-label">2022年第三季度拟完成投资</div>
                                <div class="info-value" th:text="${project.planInvestQuarter3 != null?#numbers.formatDecimal(project.planInvestQuarter3,1,2):'-'} + ' 亿元'"></div>
                            </div>
                            <div class="col-sm-3">
                                <div class="info-label">2022年第四季度拟完成投资</div>
                                <div class="info-value" th:text="${project.planInvestQuarter4 != null?#numbers.formatDecimal(project.planInvestQuarter4,1,2):'-'} + ' 亿元'"></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>